package gold.digger;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC191 {

    public int hammingWeight(int n) {
        int count = 0;
        while (n != 0) {
            count += n & 1;
            n = n >>> 1;
        }

        return count;
    }


    public static void main(String[] args) {
        LC191 an = new LC191();
        System.out.println(an.hammingWeight(-3));
    }
}
